function connectToDatabase()
{
  $connection = mysql_connect("potnoodle.cs.man.ac.uk", "13_COMP10120_Y7", "zj7JoDod1TrmWwQ7");
    or die('Could not connect: ' . mysql_error());
  mysql_select_db("13_COMP10120_Y7", $connection)
    or die('Could not select database');
}

function closeConnection()
{
  $connection = mysql_connect("potnoodle.cs.man.ac.uk","13_COMP10120_Y7",
  "zj7JoDod1TrmWwQ7");
  if (!$connection)
  {
    die('Could not connect: ' . mysql_error());
  }
  mysql_close($connection);
}